Dynomotion

Group: DynoMotion Message: 8023 From: Toby Rule Date: 7/30/2013
Subject: Thread in DSP C program

Hello,

 

Is it possible for a program running in the DSP to tell what thread it is running under?  I have a program that I would like to behave differently depending on which thread it is running under.

 

Thanks,

 

Toby

The information contained in this transmission is intended only for the person or entity
to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive
material. If you are not the intended recipient, please contact the sender immediately
and destroy the material in its entirety, whether electronic or hard copy. You are
notified that any review, retransmission, copying, disclosure, dissemination or other
use of, or taking of any action in reliance upon this information by persons or entities 
other than the intended recipient is prohibited.
Group: DynoMotion Message: 8025 From: Tom Kerekes Date: 7/30/2013
Subject: Re: Thread in DSP C program
Hi Toby,

Yes there is a global variable CurrentThread not declared in KMotionDef.h.  You will need to declare it.  See below:

Regards
TK

#include "KMotionDef.h"
extern int CurrentThread;       /* current thread that is/was executing  */

main()
{
    printf("Current Thread is %d\n",CurrentThread);
}


Group: DynoMotion Message: 8036 From: Toby Rule Date: 7/31/2013
Subject: Re: Thread in DSP C program
Attachments :

    Hi Tom,

     

    Perfect!  And thanks for this all your previous responses – I don’t always reply to avoid cluttering the list. 

     

    Regards,

     

    Toby